package com.java复习.练习一二四答案.demo6;

public class LeftTriangle extends Shape {
    private int base;
    private int height;

    @Override
    public void draw() {
        for(int i=0;i<height;i++){
            for(int j=0;j<i+1;j++){
                System.out.print("*");
            }
            System.out.println("");
        }
    }

    public LeftTriangle(int base, int height) {
        this.base = base;
        this.height = height;
    }

    public int getBase() {
        return base;
    }

    public void setBase(int base) {
        if(base>=1 && base<=20) {
            this.base = base;
        }else{
            System.out.println("底边长度输入错误");
            System.exit(0);
        }
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}
